<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
    function add(a, b = 1) {
        return a + b
    }

    console.log(add(2))
    console.log(add(2, 3))

    function fun(...values) {
        console.log(values.length)
    }
    fun(1, 2)
    fun(1, 2, 3)
</script>
</body>
</html>